DEFINITION MODULE VRaster;

(*
VDI Raster Functions.

UK __DATE__ __TIME__
*)

(*DEF_SWITCHES*)

FROM VDI    IMPORT XY;
FROM PORTAB IMPORT UNSIGNEDWORD,ANYBYTE,ANYWORD,ANYPOINTER,ANYTYPE;

IMPORT VDI,VAttribute;

TYPE RasterModes = (AllWhite,
                    SAndD,
                    SAndNotD,
                    SOnly,
                    NotSAndD,
                    DOnly,
                    SXOrD,
                    SOrD,
                    NOTSOrD,
                    NOTSXOrD,
                    DInvert,
                    SOrNotD,
                    NotD,
                    NotSOrD,
                    NOTSAndD,
                    AllBlack);

(* (memory) form definition block *)

TYPE MFDB = VDI.MFDB;

(* a MFDB alias, therefor VAR ARRAY OF ANYTYPE instead of VAR MFDB *)

     FDB = VDI.FDB;

(* [V]DI: [C]o[py] [R]aster [F]or[m] [O]paque ******************************)

PROCEDURE VROCpyFm(    Handle : UNSIGNEDWORD;
                       Mode   : RasterModes;
                   VAR PXY    : ARRAY OF XY;
                   VAR SrcMFDB: ARRAY OF ANYTYPE;
                   VAR DesMFDB: ARRAY OF ANYTYPE);

(* [V]DI: [C]o[py] [R]aster [F]or[m] [T]ransparent *************************)

TYPE WritingModes = VAttribute.WritingModes;

(*
CONST MdReplace = VAttribute.MdReplace;
      MdTrans   = VAttribute.MdTrans;
      MdXOR     = VAttribute.MdXOR;
      MdErase   = VAttribute.MdErase;
*)

PROCEDURE VRTCpyFm(    Handle    : UNSIGNEDWORD;
                       Mode      : WritingModes;
                   VAR PXY       : ARRAY OF XY;
                   VAR SrcMFDB   : ARRAY OF ANYTYPE;
                   VAR DesMFDB   : ARRAY OF ANYTYPE;
                       PixelColor: UNSIGNEDWORD;
                       BackGround: UNSIGNEDWORD);

(* [V]DI: [Tr]a[n]sform [R]aster [F]or[m] **********************************)

PROCEDURE VRTrnFm(    Handle : UNSIGNEDWORD;
                  VAR SrcMFDB: ARRAY OF ANYTYPE;
                  VAR DesMFDB: ARRAY OF ANYTYPE);

(* [V]DI: [Get] [Pixel] ****************************************************)

PROCEDURE VGetPixel(    Handle: UNSIGNEDWORD;
                        X     : XY;
                        Y     : XY;
                    VAR Pel   : BOOLEAN;
                    VAR Index : UNSIGNEDWORD);

END VRaster.
